# -*- encoding: utf-8 -*-
'''
@File    :   4.py
@Time    :   2022/12/15 16:16:38
@Author  :   Cms 
@Version :   1.0
@Contact :   2267000140@qq.com
@WebSite    :   www.baidu.com
'''

# here put the import lib

# 四 .封装一个学生类，有姓名，有年龄，有性别，有英语成绩，数学成绩，语文成绩，
#       封装方法，求单个学生的总分，平均分，以及打印学生的信息。

class Student(object):

    def __init__(self,name,age,sex,english,math,chinese):
        self.name = name
        self.age = age
        self.sex = sex
        self.english = english
        self.math = math
        self.chinese = chinese
    

    def sumScore(self):
        return (self.english+self.math+self.chinese)

    def avgScore(self):
        return (self.english+self.math+self.chinese)/3
    
    def getmessage(self):
        print("姓名：",self.name)
        print("年龄：",self.age)
        print("性别：",self.sex)
        print("英语成绩：",self.english)
        print("数学成绩：",self.math)
        print("语文成绩：",self.chinese)

s1 = Student('jame',18,'男',90,85,80)
s1.getmessage()
print(s1.sumScore())
print(s1.avgScore())